<!--
/**
* Author: gaohui
* Date: 2023-03-07 17:32
* Desc: TestTable 表格组件测试
*/
-->

<template>
  <my-table-data :tableConfig="tableConfig" :fn="getDataList"> </my-table-data>
</template>

<script name="TestTable" lang="ts" setup>
import { computed } from "vue";
import MyTableData from "./components/MyTableData.vue";
import "@/mock/index";
import { showMessage } from "@/utils/msgUtil";
import { page } from "@/api/mockApi";
import { tableConfigFn } from "./config";

const getDataList = (query) => {
  return page(query);
};

const handleClick = (type: "detail", row, index) => {
  if (type === "detail") {
    const { account } = row;
    showMessage(`您点击了第${index + 1}行,账号为：${account}`);
  }
};

const tableConfig = computed(() => {
  return tableConfigFn(handleClick);
});
</script>
<style lang="scss" scoped></style>
